﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SDT.Admin.ViewModels.EditCommentViewModels>" %>

<%@ Import Namespace="SDT.Lib.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
   Quản lý bình luận
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" runat="server">
    Sửa bình luận
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Toolbar" runat="server">
    <td>
        <%= Html.Toolbar("Quay về", "/Comments", "back") %>
    </td>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%if (ViewData["MessageInfo"] == null)
      { %>
    <% using (Html.BeginForm("Edit", "Comments", FormMethod.Post, new { id = "adminForm", enctype = "multipart/form-data" }))
       {%>
    <%= Html.ValidationSummary(true)%>
    <table class="admintable" width="100%">
        <tbody>
            <tr>
                <td class="key">
                    Tiêu đề (<font color="red">*</font>):
                </td>
                <td>
                    <%=Html.TextBoxFor(m=>m.Title, new { style = "width:400px;", @class="required" })%>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Trạng thái hiển thị
                </td>
                <td>
                <%if(Model.PublishYN){ %>
                    <%= Html.RadioButton("PublishYN", true, new { @checked = "checked" })%>
                    Kích hoạt
                    <%= Html.RadioButton("PublishYN", false) %>
                    Không kích hoạt
                    <%}else{ %>
                     <%= Html.RadioButton("PublishYN", true)%>
                    Kích hoạt
                    <%= Html.RadioButton("PublishYN", false, new { @checked = "checked" })%>
                    Không kích hoạt
                    <%} %>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Nội dung
                </td>
                <td>
                    <%=Html.TextAreaFor(m=>m.Content, new { style="width:500px; height:200px" })%>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="submit" id="btnSave" value="Lưu thay đổi" name ="btnSave" />
                    <input type="reset" id="btnReset" value="Nhập lại" name ="btnReset" />
                </td>
            </tr>
        </tbody>
    </table>
    <%}
  } %>

    <script type="text/javascript">
    	$(document).ready(function() {
    		$("#adminForm").validate({
    			rules: {
    				"Title": "required"
    			},
    			messages: {
    				"Title": "Thông tin bắt buộc phải nhập"
    			}
    		});
    	});        
    </script>

</asp:Content>
